"""
#  实现机制表
1 将避障成功的存储到表中, 注意避障成功的管道会生成多余管道
2
"""
import numpy as np
from pprint import pprint

def save_txt():
    pass

# 获取管道的基本信息，包括管道组id 管道起点终点宽高 是否避障 管道uid 管道类型
def find_pipeinfo(pipeBase):
    global uid, pipeInfo, if_successful_avoid
    arr = []
    arr1 = []
    pipeinfo_arr = []
    for pipGroup in pipeBase._pipeGroups:
        for pipList in pipGroup._pipeLists:
            for pipe in pipList._pipes:
                uid = pipe.uid
                pipeInfo = pipe.pipeInfo
                if_successful_avoid = pipe.if_successful_avoid
                arr1.extend([uid,pipeInfo,if_successful_avoid])
        type = pipGroup.type
        arr.extend([type, arr1])

        pipeGroupNo = pipGroup.pipeGroupNo

        # print(pipeGroupNo, arr)

        pipeinfo_arr.append([pipeGroupNo, arr])
        arr = []
        arr1 = []

    pprint(pipeinfo_arr)
    # return pipeinfo_arr



